﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace EFong.Contract
{
    [DataContract]
    public class Order
    {
        public Order() 
        {
            CustomerStatus = "未收款";
            VendorStatus = "未付款";
        }

        private Guid _id = Guid.NewGuid();
        [DataMember]
        public Guid ID
        {
            get { return _id; }
            set { _id = value; }
        }

        private string _ref = string.Empty;
        [DataMember]
        public string Ref
        {
            get { return _ref; }
            set { _ref = value; }
        }

        private string _orderType = string.Empty;
        [DataMember]
        public string OrderType
        {
            get { return _orderType; }
            set { _orderType = value; }
        }

        private User _orderUser;
        [DataMember]
        public User OrderUser
        {
            get { return _orderUser; }
            set { _orderUser = value; }
        }

        private string _orderUserText = string.Empty;
        [DataMember]
        public string OrderUserText
        {
            get { return _orderUserText; }
            set { _orderUserText = value; }
        }

        private DateTime? _orderDate = DateTime.Now;
        [DataMember]
        public DateTime? OrderDate
        {
            get { return _orderDate; }
            set { _orderDate = value; }
        }

        private decimal _money;
        [DataMember]
        public decimal Money
        {
            get { return _money; }
            set { _money = value; }
        }

        public string MoneyC 
        {
            get 
            {
                if (MoneyCurrency == null)
                    return string.Empty;

                return string.Format("{0} {1}", MoneyCurrency.Name, Money);
            }
        }

        private Currency _moneyCurrency;
        [DataMember]
        public Currency MoneyCurrency
        {
            get { return _moneyCurrency; }
            set { _moneyCurrency = value; }
        }

        private string _remark = string.Empty;
        [DataMember]
        public string Remark
        {
            get { return _remark; }
            set { _remark = value; }
        }

        private string _customerStatus = string.Empty;
        [DataMember]
        public string CustomerStatus
        {
            get { return _customerStatus; }
            set { _customerStatus = value; }
        }

        private string _vendorStatus = string.Empty;
        [DataMember]
        public string VendorStatus
        {
            get { return _vendorStatus; }
            set { _vendorStatus = value; }
        }

        private decimal _intergral;
        [DataMember]
        public decimal Intergral
        {
            get { return _intergral; }
            set { _intergral = value; }
        }

        private bool _isSelect;
        public bool IsSelect 
        {
            get { return _isSelect; }
            set { _isSelect = value; }
        }

        private string _vendorText = string.Empty;
        [DataMember]
        public string VendorText
        {
            get { return _vendorText; }
            set { _vendorText = value; }
        }
    }
}

